<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition >


            <p:panel >
                <h:panelGrid columns="1" >
                    <p:commandButton value="Novo Insert" 
                                     icon="iconNovo"
                                     id="btnNovo"
                                     action="#{eventoBean.novo()}"
                                     update=":geral:pnlProcesso"/>

                </h:panelGrid>
            </p:panel>

            <br/>

            <p:dataTable id="dtAnjo" var="evento"  value="#{eventoBean.eventos}"
                         paginator="true" rows="5"
                         paginatorPosition="top"
                         selection="#{eventoBean.evento}" selectionMode="single"
                         rowKey="#{evento.id}"
                         style="width: auto; height: auto"
                         emptyMessage="Sem Registros">

                <f:facet name="header">
                    Lista de Eventos
                    <p:commandButton value="Incluir Anjos"
                                     action="#{eventoBean.irIncluirAnjos}"
                                     update=":geral:pnlProcesso"/>
                </f:facet>

                <p:column headerText="Nome">
                    <h:outputText value="#{evento.nome}"/>
                </p:column>

                <p:column headerText="Data Inicio">
                    <h:outputText value="#{evento.inicio}" converter="data"/>
                </p:column>

                <p:column headerText="Data Fim">
                    <h:outputText value="#{evento.final1}" converter="data"/>
                </p:column>
                

            </p:dataTable>


        </ui:composition>

    </body>
</html>
